package com.niiwoo.civet.trade.service.dubbo.newRefund;

import com.alibaba.dubbo.config.annotation.Service;
import com.niiwoo.civet.trade.dto.response.myloan.GetWithholdRepaymentResultDTO;
import com.niiwoo.civet.trade.dto.response.myloan.QueryRepaymentProjectSummaryDTO;
import com.niiwoo.civet.trade.dto.response.myloan.RefundGuideContentResponseDTO;
import com.niiwoo.civet.trade.service.local.newRefund.callback.RefundBankBackLocalService;
import com.niiwoo.civet.trade.service.local.newRefund.common.RefundLocalService;
import com.niiwoo.civet.trade.service.local.newRefund.refundDeal.core.FreezeDealingService;
import com.niiwoo.civet.trade.service.local.newRefund.refundDeal.core.RefundDetailHandlerService;
import com.niiwoo.civet.trade.service.local.newRefund.refundDeal.core.UnFreezeDealingService;
import com.niiwoo.civet.trade.service.local.refund.RepaymentRemindLocalService;
import com.niiwoo.civet.trade.service.newRefund.RefundDubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;

@Service(version = "1.0.0")
public class RefundDubboServiceImpl implements RefundDubboService {

    @Autowired
    private FreezeDealingService freezeDealingService;

    @Autowired
    private UnFreezeDealingService unFreezeDealingService;

    @Autowired
    protected RefundBankBackLocalService refundBankBackLocalService;
    
    @Autowired
    private RepaymentRemindLocalService repaymentRemindLocalService;

    @Autowired
	private RefundDetailHandlerService refundDetailHandlerService;
    
	@Autowired
	private RefundLocalService refundLocalService;


    @Override
    public void freezeDealBatch() {
        freezeDealingService.freezeDealBatch();
    }

    @Override
    public void unFreezeDealBatch() {
        unFreezeDealingService.unFreezeDealBatch();
    }

    @Override
    public void bankRefundResultQueryJob() {
        refundBankBackLocalService.bankRefundResultQueryJob();
    }

    @Override
    public void receivedRepaymentSuccessAccountingJob() {
        refundBankBackLocalService.receivedRepaymentSuccessAccountingJob();
    }

	@Override
	public void sendRepaymentRemindMessageForJob() {
		repaymentRemindLocalService.sendNormalRepaymentRemindMessage();
	}

	@Override
	public void sendRepaymentOverdueMessageForJob() {
		repaymentRemindLocalService.sendOverdueRepaymentRemindMessage();
	}

	@Override
	public GetWithholdRepaymentResultDTO getWithholdRepaymentResult(Long projectId, String orgRequestNo) {
		return refundLocalService.getWithholdRepaymentResult(projectId, orgRequestNo);
	}

	@Override
	public QueryRepaymentProjectSummaryDTO getRepaymentProjectSummary(Long projectId) {
		return refundLocalService.getRepaymentProjectSummary(projectId);
	}

	@Override
	public void repeatDetailOrderForJob() {
		refundDetailHandlerService.processPartFailDetailOrderForJob();
	}


	@Override
	public void repeatDetailOrder(Long refundOrderId) {
		refundDetailHandlerService.handlePartFailedRefund(refundOrderId);
	}

	@Override
	public RefundGuideContentResponseDTO refundGuideContent(String userId){
		Assert.notNull(userId,"用户ID不可空");
		return refundLocalService.refundGuideContent(userId);
	}


}